home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19981211-19990422 / 000182_news@watsun.cc.columbia.edu _Tue Feb 2 13:20:32 1999.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Return-Path: <news@watsun.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id NAA29653
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Tue, 2 Feb 1999 13:20:31 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id NAA09060
  7.     for kermit.misc@watsun.cc.columbia.edu; Tue, 2 Feb 1999 13:19:00 -0500 (EST)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Subject: Re: Serial Line
  11. Date: 2 Feb 1999 18:19:00 GMT
  12. Organization: Columbia University
  13. Message-ID: <797fik$8r1$1@newsmaster.cc.columbia.edu>
  14. To: kermit.misc@mailrelay2.cc.columbia.edu
  15.  
  16. In article <797esf$k18$1@news.cs.tu-berlin.de>,
  17. Janko Dimitroff  <janko@cs.tu-berlin.de> wrote:
  18. : I have a problem using kermit.
  19. : I want to communicate with a device which is plugged in the serial line.  I
  20. : wrote a script which is able to establish a connection to the device.  Now
  21. : the device sends data. How can I check these data, read it to variables and
  22. : so on.
  23. : I want to send data to the device if a string containing a special substring
  24. : was received by the computer.  On account of the fact that I do not know
  25. : exactly what data (only a substring) comes in I can not use INPUT or MINPUT.
  26. : Can I just wait for \n ?
  27. Yes:
  28.  
  29.   INPUT <number> \10  (or \13, or \10,\13)
  30.  
  31. : How is data handled by INPUT/MINPUT if it does not match with the
  32. : given text? 
  33. As explained in the manual, it is stored in the \v(input) variable, which
  34. represents a circular buffer. 
  35.  
  36. : You understood my problem hopefully and have a solution.
  37.  
  38. If you know what the substring, why don't you just look for it?
  39.  
  40. If you don't know what you are looking for, how will find it?
  41.  
  42. You can use INPUT or MINPUT to look for strings, or you can use them
  43. to read "lines" of text as follows:
  44.  
  45.   while true {
  46.       input 20 \13\10          ; Read a line
  47.       if fail ...              ; Do something if INPUT times out
  48.       ; Process the line here
  49.       ; The \v(input) variable
  50.       ; contains the line.
  51.       clear input              ; Clear the input buffer and wait 
  52.   }                            ; for another line.
  53.  
  54. See the manual for details:
  55.  
  56.   http://www.columbia.edu/kermit/ck60manual.html
  57.  
  58. - Frank